﻿
@page
@model AdminUI.Pages.BaseData.TenantEditModel
@{
    var F = Html.F();
}

@section body{
    <f:Form ID="Form1" ShowBorder="false" ShowHeader="false" AutoScroll="true" BodyPadding="15" IsViewPort="true">
        <Rows>
            <f:FormRow ColumnWidths="30% 54% 8% 8%">
                <Items>
                    <f:HiddenField ID="TenantID" Text="@Model.Current.TenantID"></f:HiddenField>
                    <f:DropDownList ID="WxAppID" Label="宿主应用" DataValueField="WxAppID" DataTextField="WxAppName" SelectedValue="@Model.Current.WxAppID" DataSource="@ViewBag.WxAppList"></f:DropDownList>
                    <f:TextBox ID="TenantName" Required="true" Label="租户名称" Text="@Model.Current.TenantName" EmptyText="请输入租户名称" ShowRedStar="true"></f:TextBox>
                   @*  <f:CheckBox ID="IsPublic" Text="公开" Checked="@Model.Current.IsPublic"></f:CheckBox>
                    <f:CheckBox ID="IsEnable" Text="启用" Checked="@Model.Current.IsEnable"></f:CheckBox> *@
                    @*<f:CheckBox ID="IsDebug" Text="调试模式" Checked="@Model.Current.IsDebug"></f:CheckBox>*@
                </Items>
            </f:FormRow>
            <f:FormRow ColumnWidths="30% 70%">
                <Items>
                    @* <f:NumberBox ID="ServiceRate" Label="服务分成" Text="@Model.Current.ServiceRate" MaxValue="1" MinValue="0" NoDecimal="false" ShowTrigger="true" Increment="0.01"></f:NumberBox> *@
                    @* <f:FileUpload ID="LogoUrl" Label="Logo图片" Text="@Model.Current.LogoUrl" AcceptFileTypes="image/*" ButtonIcon="Add"></f:FileUpload> *@
                </Items>
            </f:FormRow>
            <f:FormRow ColumnWidths="30% 70%">
                <Items>
                    <f:TextBox ID="Phone" Label="联系电话" Text="@Model.Current.Phone" EmptyText="请输入联系电话" Required="false"></f:TextBox>
                    <f:TextBox ID="Address" Label="联系地址" Text="@Model.Current.Address" EmptyText="请输入联系地址" Required="false"></f:TextBox>
                </Items>
            </f:FormRow>
            @*<f:FormRow ColumnWidths="30% 30% 40%">
                <Items>
                    <f:DropDownList ID="BankName" Label="结算银行" SelectedValue="@Model.Current.BankName">
                        <f:ListItem Text="请选择结算银行" Value="" />
                        <f:ListItem Text="中国银行" Value="中国银行" />
                        <f:ListItem Text="工商银行" Value="工商银行" />
                        <f:ListItem Text="农业银行" Value="农业银行" />
                        <f:ListItem Text="建设银行" Value="建设银行" />
                        <f:ListItem Text="招商银行" Value="招商银行" />
                        <f:ListItem Text="民生银行" Value="民生银行" />
                        <f:ListItem Text="邮储银行" Value="邮储银行" />
                        <f:ListItem Text="交通银行" Value="交通银行" />
                    </f:DropDownList>
                    <f:TextBox ID="BankAccountName" Required="false" Label="开户姓名" Text="@Model.Current.BankAccountName"></f:TextBox>
                    <f:TextBox ID="BankAccountNo" Required="false" Label="银行卡号" Text="@Model.Current.BankAccountNo"></f:TextBox>
                </Items>
            </f:FormRow>*@
            <f:FormRow ColumnWidths="30% 30% 40%">
                <Items>
                    @* <f:DatePicker ID="ExpiredDate" Label="有效期至" DateFormatString="yyyy-MM-dd" EnableEdit="false" Required="false" SelectedDate="@Model.Current.ExpiredDate"></f:DatePicker> *@
                </Items>
            </f:FormRow>
           @* <f:FormRow ColumnWidths="30% 30% 40%">
                <Items>
                    <f:NumberBox ID="MemberFee" Label="会员费" EmptyText="" Text="@Model.Current.MemberFee" MaxValue="100000" MinValue="0" NoDecimal="false" DecimalPrecision="2" ShowTrigger="false"></f:NumberBox>
                    <f:DropDownList ID="ChargeMethod" Label="收费方式" SelectedValue="@Model.Current.ChargeMethod">
                        <f:ListItem Text="不收会员费" Value="0" />
                        <f:ListItem Text="一次性收费" Value="1" />
                        <f:ListItem Text="按年收费" Value="2" />
                    </f:DropDownList>
                </Items>
            </f:FormRow>*@
            <f:FormRow ColumnWidths="100%">
                <Items>
                    <f:TextArea ID="Memo" Label="租户介绍" Text="@Model.Current.Memo" EmptyText="请输入租户介绍" AutoGrowHeight="true" AutoGrowHeightMin="200" AutoGrowHeightMax="600"></f:TextArea>
                </Items>
            </f:FormRow>
        </Rows>
        <Toolbars>
            <f:Toolbar ID="Toolbar1" Position="Top" ToolbarAlign="Left">
                <Items>
                    <f:Button ID="btnClose" Text="关闭" Icon="Cross" IconFont="Close" OnClientClick="F.activeWindow.hide();"></f:Button>
                    <f:Button ID="btnReset" Text="重置" Icon="ArrowUndo" OnClientClick="F.ui.Form1.reset();"></f:Button>
                    <f:Button ID="btnSubmit" Text="保存" Icon="SystemSave" OnClick="@Url.Handler("btnSubmit_Click")" _ValidateForms="Form1" OnClickFields="Form1"></f:Button>
                </Items>
            </f:Toolbar>
        </Toolbars>
    </f:Form>
    
    <f:Window ID="Window1" IsModal="true" Hidden="true" Target="Top" EnableResize="true" EnableMaximize="true" EnableIFrame="true" Width="400" Height="500">
        <Listeners>
            <f:Listener Event="close" Handler="onWindowClose('refresh');"></f:Listener>
        </Listeners>
    </f:Window>

}

@section script {
    <script>
        function onSelectArea(event) {
            var path = "/Dialog/SelectArea?t=3";
            F.ui.Window1.show(path, '选择上级菜单（双击选择）', 400, 500);
        }

        function updateTreeSelectValue(treeNode) {
            F.ui.CountyName.setText(treeNode.id + '-' + treeNode.text);
            F.ui.CountyID.setValue(treeNode.id);

            //F.doPostBack('@Url.Handler("County_Change")', {
            //    'countyID': F.ui.CountyID.getValue()
            //});
        }
    </script>
}
